<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>9.JQuery入门</title>

		<!--1.引入脚本-->
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>

		<script>
			$(function() {
				$("#btn_run").click(
					function() {
						alert("hello JQuery!");
					}
				);

				//1.JS方式获取
				/*document.getElementById("btn_jinxi").onclick= function(){
					location.href="打飞机.html";
				}*/

				//2.JQ方式获取=====>>>$("#btn_jinxi")
				$("#btn_jinxi").click(function() {
					location.href = "打飞机.html";
				});
			});
		</script>
	</head>

	<body>
		<p>
			<font color="red" size="7">1.hello JQuery!</font>
		</p>

		&lt;script>
		<br /> &emsp;$(function() {
		<br /> &emsp; &emsp;$("#btn_run").click(
		<br /> &emsp;&emsp;&emsp;function() {
		<br /> &emsp;&emsp;&emsp;&emsp;alert("hello JQuery!");
		<br /> &emsp;&emsp;&emsp;}
		<br /> &emsp;&emsp;);
		<br /> &emsp;});
		<br /> &lt;/script>

		<p><input id="btn_run" type="button" value="运行" /></p>

		<hr size="1" />
		<!--------------------------------------------------------1-------------------------------------------------------->

		<p>
			<font color="red" size="7">2.点我打飞机</font>
		</p>

		&lt;script>
		<br /> &emsp;$(function() {
		<br /> &emsp; &emsp;$("#btn_jinxi").<font color="red">click</font>(function() {
		<br /> &emsp;&emsp;&emsp;location.href = "打飞机.html";
		<br /> &emsp;&emsp;});
		<br /> &emsp;});
		<br /> &lt;/script>

		<p><input id="btn_jinxi" type="button" value="点我打飞机" /></p>
	</body>

</html>